package properties;

import java.io.InputStream;
import java.util.Properties;



public class SrcProperties {

	static protected String JNDI_NAME;	
	static protected String RUTA_TEMPORAL;	
	static protected String DOCUMENTS_PATH;
	
	static{
		try {
			String path = "/properties/SrcServer.properties";
			InputStream in = SrcProperties.class.getResourceAsStream(path);			
			Properties props = new Properties();    
			props.load(in);
			JNDI_NAME = props.getProperty("JNDI_NAME");
			RUTA_TEMPORAL = props.getProperty("RUTA_TEMPORAL");
			DOCUMENTS_PATH = props.getProperty("DOCUMENTS_PATH");
			props.load(in);	
			
			System.out.println("Properties cargado, levantando CRON");
			
		} catch (Exception e) {		
			System.out.println("catch clase SrcProperties");
		}
	}
	
	static public String JNDI_NAME(){		
		if(JNDI_NAME==null)
			new SrcProperties();
		return JNDI_NAME;	
	}
	
	static public String RUTA_TEMPORAL(){		
		if(RUTA_TEMPORAL==null)
			new SrcProperties();
		return RUTA_TEMPORAL;	
	}
	
	static public String DOCUMENTS_PATH(){		
		if(DOCUMENTS_PATH==null)
			new SrcProperties();
		return DOCUMENTS_PATH;	
	}
}
